import { ModuleConfig } from '../../../bootstrap/interface';
import { routes } from './routes';
import en_api from './i18n/en_api.json';
import ru_api from './i18n/ru_api.json';
import { handlers } from './mocks';
import { Bootstrap } from '../../../bootstrap';
import { UserModel } from '../models/user.model.ts';
import { UserEntity } from '../models/user.entity.ts';

export default {
  ROUTES: () => routes,

  I18N: (i18n) => {
    i18n.addResourceBundle('en', 'user', en_api);
    i18n.addResourceBundle('ru', 'user', ru_api);
  },
  onModuleInit: async (bootstrap: Bootstrap) => {
    const userModel = bootstrap.di.get<UserModel>(UserModel);
    userModel.initialize({
      name: 'John Doe',
    });

    userModel.addConnectedUser(
      new UserEntity({
        name: 'John Doe2',
        id: 2,
        _initialized: true,
        color: 'red',
      }),
    );
  },
  mockHandlers: handlers,
} as ModuleConfig;
